#ifndef _C_MY_SOCKET_
#define _C_MY_SOCKET_

#include <WinSock2.h>
#pragma comment (lib, "ws2_32.lib")
#pragma   warning(disable:4996)

class CMySkt
{
private:
	static VOID Init();
	static SOCKET CreatTcpSocket();
	static VOID Bind(SOCKET &servSock, char ip[], u_short port);
	static VOID Bind(SOCKET &servSock, sockaddr_in& addr);
public:
	static SOCKET Listen(char ip[], u_short port, DWORD backlog = SOMAXCONN);
	static SOCKET Accept(SOCKET& servSock, sockaddr_in &clntAddr);
	static SOCKET Connect(OUT SOCKET& sock, char ip[], u_short port);
	static BOOL Send(SOCKET& sock, LPVOID data, UINT dataSize);
	static BOOL RecvAll(SOCKET& sock, LPVOID data, UINT dataSize);
	static BOOL Recv(SOCKET& sock, LPVOID data, IN OUT UINT &dataSize);
	static VOID Clean();
};

#endif // !_C_MY_SOCKET_

